<template>
	<view>
		<TopNavCustom title="项目管理"></TopNavCustom>
		<view class="container">
			<text class="label">当前项目</text>
			<view class="top">
				<u-cell :title="selected_item"></u-cell>
			</view>
			<view class="bottom">
				<text class="label">其他项目</text>
				<view class="list" v-for="(item, index) in project_list" :key="index">
					<u-cell :title="item.floorName"></u-cell>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import _public from "@/common/public.js"
	export default {
		data() {
			return {
				selected_item: '',
				project_list: [],
				allList: [],
			};
		},
		created() {
			this.init();
		},
		methods: {
			async init() {
				this.selected_item=uni.getStorageSync('selectedProject')
				const {
					body
				} = await uni.$H.post('/userEstateMap/getByQuery', {
					estateType: '2',
					roleId: "4",
					userId: uni.getStorageSync('userId')
				}, {
					authCode: true
				})
				console.log(body)
				if (body.length != 0) {
					this.allList = body;
					console.log(this.allList)
					
					let _t = []
					for (let i = 0; i < this.allList.length; i++) {
						if (this.selected_item != this.allList[i].businessRealEstateVO.floorName){
							console.log("ecsdd")
								_t.push(this.allList[i].businessRealEstateVO)
						}
					}
					this.project_list = _t
				}
			},
		},
	};
</script>

<style lang="scss" scoped>
	.label {
		font-size: 24rpx;
		font-weight: 500;
		color: #999999;
	}

	.container {
		padding: 30rpx;

		.top {
			margin-top: 20rpx;
			border-radius: 20rpx;
			background-color: #ffffff;
		}

		.list {
			margin-top: 20rpx;
			background-color: #ffffff;
			border-radius: 20rpx;
		}
	}
</style>
